/*
 * 
 *  jiangcheng
 *  
 */

package com.uhaou.web.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;
import org.apache.commons.lang.StringUtils;

import com.uhaou.common.base.*;
import com.uhaou.common.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.uhaou.web.model.*;
import com.uhaou.web.dao.*;
import com.uhaou.web.service.*;
import com.uhaou.web.vo.query.*;

/**
 * @author  jiangcheng
 * @version 1.0
 * @since 1.0
 */


public class WebMessage extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "WebMessage";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_SENDER = "sender";
	public static final String ALIAS_RECEIVER = "receiver";
	public static final String ALIAS_MSG_TYPE = "msgType";
	public static final String ALIAS_TITLES = "titles";
	public static final String ALIAS_CONTENT = "content";
	public static final String ALIAS_CREATE_TIME = "createTime";
	public static final String ALIAS_IS_READ = "isRead";
	public static final String ALIAS_OWNER = "owner";
	
	//date formats
	public static final String FORMAT_CREATE_TIME = DATE_FORMAT;
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	@Length(max=32)
	private java.lang.String id;
	@Length(max=32)
	private java.lang.String sender;
	@Length(max=32)
	private java.lang.String receiver;
	@Length(max=32)
	private java.lang.String msgType;
	@Length(max=300)
	private java.lang.String titles;
	@Length(max=3000)
	private java.lang.String content;
	
	private java.util.Date createTime;
	@Length(max=32)
	private java.lang.String isRead;
	@Length(max=32)
	private java.lang.String owner;
	//columns END

	public WebMessage(){
	}

	public WebMessage(
		java.lang.String id
	){
		this.id = id;
	}

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	public java.lang.String getId() {
		return this.id;
	}
	public void setSender(java.lang.String value) {
		this.sender = value;
	}
	
	public java.lang.String getSender() {
		return this.sender;
	}
	public void setReceiver(java.lang.String value) {
		this.receiver = value;
	}
	
	public java.lang.String getReceiver() {
		return this.receiver;
	}
	public void setMsgType(java.lang.String value) {
		this.msgType = value;
	}
	
	public java.lang.String getMsgType() {
		return this.msgType;
	}
	public void setTitles(java.lang.String value) {
		this.titles = value;
	}
	
	public java.lang.String getTitles() {
		return this.titles;
	}
	public void setContent(java.lang.String value) {
		this.content = value;
	}
	
	public java.lang.String getContent() {
		return this.content;
	}
	public String getCreateTimeString() {
		return DateConvertUtils.format(getCreateTime(), FORMAT_CREATE_TIME);
	}
	public void setCreateTimeString(String value) {
		setCreateTime(DateConvertUtils.parse(value, FORMAT_CREATE_TIME,java.util.Date.class));
	}
	
	public void setCreateTime(java.util.Date value) {
		this.createTime = value;
	}
	
	public java.util.Date getCreateTime() {
		return this.createTime;
	}
	public void setIsRead(java.lang.String value) {
		this.isRead = value;
	}
	
	public java.lang.String getIsRead() {
		return this.isRead;
	}
	public void setOwner(java.lang.String value) {
		this.owner = value;
	}
	
	public java.lang.String getOwner() {
		return this.owner;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Sender",getSender())
			.append("Receiver",getReceiver())
			.append("MsgType",getMsgType())
			.append("Titles",getTitles())
			.append("Content",getContent())
			.append("CreateTime",getCreateTime())
			.append("IsRead",getIsRead())
			.append("Owner",getOwner())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof WebMessage == false) return false;
		if(this == obj) return true;
		WebMessage other = (WebMessage)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

